package org.service.impl;

import org.dao.impl.UserDaoImpl;
import org.entity.User;
import org.entity.UserData;
import org.service.IUserSerice;

public class UserSericeImpl implements IUserSerice{

	@Override
	public boolean queryUser(String username) {
		UserDaoImpl dao = new UserDaoImpl();
		return dao.queryUser(username);
	}

	@Override
	public boolean queryPassword(User user) {
		UserDaoImpl dao = new UserDaoImpl();
		return dao.queryPassword(user);		
	}

	@Override
	public void addUserData(UserData userData) {
		UserDaoImpl dao = new UserDaoImpl();
		if(dao.queryUserExits(userData)){
			dao.addUserData(userData);
		}else{
			dao.alterUserData(userData);
		}
	}

}
